<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ include file="/WEB-INF/views/include/constrant.jsp"%>
<html>
<head>
<%@ include file="/WEB-INF/views/wx/include/head.jsp" %>
</head>
<body>
	<div class="mui-off-canvas-wrap mui-draggable">
		<!--菜单部分-->
		<aside class="mui-off-canvas-right filter-bg">
			<div id="offCanvasSideScroll" class="mui-scroll-wrapper">
				<div class="mui-scroll">
					<form action="${ctxWx }/pu/rentproduct/list" method="get">
						<input type="hidden" name="rentType" value="${tRentproduct.rentType }"/>
						<input type="hidden" id="tabType" name="tabType" value="${tRentproduct.tabType }">
						<input type="hidden" name="departcity.siteid" value="${tRentproduct.departcity.siteid }">
						<input type="hidden" name="destcity.siteid" value="${tRentproduct.destcity.siteid }">
						<input type="hidden" name="departcity.sitename" value="${tRentproduct.departcity.sitename }">
						<input type="hidden" name="destcity.sitename" value="${tRentproduct.destcity.sitename }">
						<input type="hidden" name="fromdateStr" value="${tRentproduct.fromdateStr }">
						<input type="hidden" name="time" value="${tRentproduct.time }">
						<input type="hidden" name="daysnum" value="${tRentproduct.daysnum }"/>
						<p class="mui-content-padded filter-title">筛选条件</p>
						<h5 class="mui-content-padded">车型</h5>
						<div class="mui-card">
							<div class="mui-input-row mui-radio">
								<label>不限</label>
								<input name="cargotype.cargotypeid" type="radio" value="" ${empty tRentproduct.cargotype.cargotypeid?'checked':'' }>
							</div>
							<c:forEach items="${cargotypeList }" var="cargotype">
								<div class="mui-input-row mui-radio">
									<label>${cargotype.typename }</label>
									<input name="cargotype.cargotypeid" type="radio" value="${cargotype.cargotypeid }" ${tRentproduct.cargotype.cargotypeid == cargotype.cargotypeid?'checked':'' }>
								</div>
							</c:forEach>
						</div>
						<h5 class="mui-content-padded">服务商</h5>
						<div class="mui-card">
							<div class="mui-input-row mui-radio">
								<label>不限</label>
								<input name="office.id" type="radio" value="" ${empty tRentproduct.office.id?'checked':'' }>
							</div>
							<c:forEach items="${officeList }" var="office">
								<div class="mui-input-row mui-radio">
									<label>${office.name }</label>
									<input name="office.id" type="radio" value="${office.id }" ${tRentproduct.office.id == office.id?'checked':'' }>
								</div>
							</c:forEach>
						</div>
						<div class="mui-content-padded">
							<button type="submit" class="mui-btn mui-btn-primary mui-btn-block">查询</button>
						</div>
					</form>
				</div>
			</div>
		</aside>
		<div class="mui-inner-wrap">
			<header class="mui-bar mui-bar-nav">
				<button id="back" class="mui-btn mui-btn-blue mui-btn-link mui-pull-left">返回</button>
				<button id="offCanvasContentBtn" class="mui-btn mui-btn-blue mui-btn-link mui-pull-right">筛选</button>
				<c:set var="destName" value="-${tRentproduct.destcity.sitename }"/>
				<h1 class="mui-title">${tRentproduct.departcity.sitename}${tRentproduct.tabType eq '跨市'?destName:'市内' }${tRentproduct.daysnum }日按天包车</h1>
			</header>
			<div class="mui-content mui-scroll-wrapper">
				<div class="mui-row date-navigate">
					<div class="mui-col-sm-3 mui-col-xs-3 pre-day">
						<a href="${preUrl }"><i class="icon-angle-left"></i>&nbsp;前一天</a>
					</div>
					<div class="mui-col-sm-6 mui-col-xs-6 curr-day">
						<a href="javascript:;">${departdateWeek }</a>
					</div>
					<div class="mui-col-sm-3 mui-col-xs-3 next-day">
						<a href="${nextUrl }">后一天&nbsp;<i class="icon-angle-right"></i></a>
					</div>
				</div>
				<div id="pullrefresh" class="mui-content mui-scroll-wrapper fix-push-top">
					<div class="mui-scroll">
						<c:if test="${not empty messagesFor12Hour }"><div class="warn-tip">温馨提示：${messagesFor12Hour }</div></c:if>
						<c:choose>
							<c:when test="${not empty page.list}">
								<ul id="view_list" class="mui-table-view">
									<c:forEach items="${page.list}" var="rentproduct">
										<li class="mui-table-view-cell mui-media" data-url="${ctxWx}/pu/rentproduct/details?rentid=${rentproduct.rentid}&time=${tRentproduct.time }&daysnum=${tRentproduct.daysnum }&tabType=${tRentproduct.tabType }&rentType=${tRentproduct.rentType }&fromdateStr=${tRentproduct.fromdateStr }&destcity.sitename=${tRentproduct.destcity.sitename}">
											<c:if test="${not empty rentproduct.cargotype.cartypelogo }">
												<c:set var="cargotypeImg" value="${rentproduct.cargotype.cartypelogo }"></c:set>
											</c:if>
											<c:if test="${empty rentproduct.cargotype.cartypelogo }">
												<c:set var="cargotypeImg" value="${ctxStatic }/xiake/images/126 (3).png"></c:set>
											</c:if>
											<img class="mui-media-object cartype-logo mui-pull-left" src="${cargotypeImg }">
											<div class="mui-media-body">
												<p class="mui-ellipsis">
													<span class="cargotype">${rentproduct.cargotype.typename}</span>
												</p>
												<p class="mui-ellipsis" style="color:#000000;">${rentproduct.cargotype.typedesc}</p>
												<p class="icon-area2">
													<img class="icon-item" src="${ctxStatic }/modules/wx/images/man.png"><span class="icon-item-span">×${rentproduct.seats}</span>
													<img class="icon-item" src="${ctxStatic }/modules/wx/images/seats.png"><span class="icon-item-span">×${rentproduct.packs}</span>
												</p>
												<c:if test="${rentproduct.cargotype.iselectric == '1' }"><p class="mui-ellipsis"><span style="font-size:12px;">续航${rentproduct.cargotype.continuerange }公里</span></p></c:if>
												<p class="money2">
													<c:choose>
														<c:when test="${!fn:contains(rentproduct.suitrtnprice,'.00')}">
															<c:choose>
																<c:when test="${empty rentproduct.suitrtnprice }">暂无价格</c:when>
																<c:otherwise>
																	<i class="icon-yen"></i>${rentproduct.suitrtnprice }/天
																</c:otherwise>
															</c:choose>
														</c:when>
														<c:otherwise>
															<i class="icon-yen"></i>${fn:substring(rentproduct.suitrtnprice, 0, fn:length(rentproduct.suitrtnprice)-3)}
														</c:otherwise>
													</c:choose>
												</p>
												<p class="small-icon2">
													<span class="type-tip t1">${rentproduct.cargotype.iselectric == '1'?'电':'油' }</span>
													<span class="type-tip t2">险</span>
													<span class="type-tip t3">驾</span>
												</p>
												<p class="office2">${rentproduct.office.abbr}</p>
											</div>
										</li>
									</c:forEach>
								</ul>
								<div class="mui-content-padded">${page.wxhtml }</div>
							</c:when>
							<c:otherwise>
								<div class="mui-content-padded">
									<p class="noproduct-tip">
										<img src="${ctxStatic }/modules/wx/images/no_data.gif"/>
										<span>没有查到信息，试试定制包车吧~</span>
									</p>
								</div>
							</c:otherwise>
						</c:choose>
					</div>
				</div>
			</div>
			<div class="mui-off-canvas-backdrop"></div>
		</div>
	</div>
	<c:set var="include_history" value="yes"/>
	<%@ include file="/WEB-INF/views/wx/include/script.jsp"%>
	<script>
		//主界面和侧滑菜单界面均支持区域滚动；
		mui('#offCanvasSideScroll').scroll();
		mui('#pullrefresh').scroll();
		$(function() {
			$('.mui-table-view-cell').on('tap', function() {
				window.location.href = $(this).attr('data-url');
			});
			$('#offCanvasContentBtn').on('tap',function(){
				mui('.mui-off-canvas-wrap').offCanvas('show');
			});
			$('#back').on('tap',function(){
				window.location.href='${ctxWx}/pu/rentproduct/query?rentType=${tRentproduct.rentType }&tabType=${tRentproduct.tabType}';
			});
			$('.date-navigate a').on('tap',function(e){
				if(e.target == this){
					window.location.href=$(this).attr('href');
				}
			});
		});
	</script>
</body>
</html>